次の項では、キャッシュ・グループの構成情報を取得する方法およびキャッシュ処理のステータスを監視する方法について説明します。
例3.27に示すように、ttIsql cachegroup
コマンドを使用すると、データ・ストアで現在使用中のキャッシュ・グループに関する情報を取得できます。
Command> cachegroup;
Cache Group TESTUSER.CUSTOMERORDERS:
AutoRefresh Mode: Incremental
AutoRefresh State: On
AutoRefresh Interval: 5 Minutes
Root Table: TESTUSER.CUSTOMER
Where Clause: (none)
Type: Read Only
Child Table: TESTUSER.ORDERTAB
Where Clause: (none)
Type: Read Only
Cache Group TESTUSER.TABCACHE:
Root Table: TESTUSER.TAB3
Where Clause: (none)
Type: Propagate
2 cache groups found.
ttCacheMonitorプロシージャを使用すると、自動リフレッシュ・アクティビティを追跡できます。
cgRefreshCountおよびcgTotalNumRowsパラメータを指定してttCacheMonitorを使用すると、AUTOREFRESHが正常に動作しているかどうかを確認できます。
自動リフレッシュが正常に動作している場合は、Oracle実表に対して変更が行われたかどうかに関係なく、自動リフレッシュ時間隔が経過するたびに、cgRefreshCountからの出力の増加が表示されます。
Command> call ttCacheMonitor ('cgRefreshCount', 'ProductInventory', NULL);
< 940 >
1 row found.
Command> call ttCacheMonitor ('cgRefreshCount', 'ProductInventory', NULL);
< 941 >
1 row found.
cgTotalNumRowsからの出力は、Oracle実表に対して変更が行われた場合にのみ増加します。値は、前回の自動リフレッシュ以降にキャッシュ・グループ表で更新された行の数を示します。
Command> call ttCacheMonitor ('cgTotalNumRows', 'ProductInventory', NULL);
< 5 >
1 row found.